package com.ionehe.group.common.uaa.ex.enums;


/**
 * Copyright (c) 2020 ionehe.com
 * Date: 2020/11/25
 * Time: 9:54 上午
 *
 * @author 2020年 <a href="mailto:a@ionehe.com">秀</a>
 */
public enum ErrorMessages implements BaseErrorEnum {

    /**
     * 错误枚举
     */
    REPEAT_ADD_BESPEAK("repeat.add","重复提交"),
    ILLEGAL_OPERATION("illegal.operation", "非法操作"),
    ILLEGAL_PARAMS("illegal.params", "参数有误"),
    LOAD_DICT_FAIL("load.dict.fail", "加载字典数据异常"),
    USER_NOT_LOGIN("user.not.login", "用户未登陆"),
    GET_USER_INFO_FAIL("get.user.info.fail", "获取用户信息异常"),
    AUTHENTICATION_FAILED("authentication.failed", "认证失败"),

    GET_FUNCTION_LIST_FAIL("get.function.list.fail", "获取权限列表异常"),
    FUNCTION_NOT_EXIST("function.not.exist", "权限不存在"),
    UPDATE_FUNCTION_STATUS_FAIL("update.function.status.fail", "更新权限状态异常"),
    UPDATE_FUNCTION_FAIL("update.function.fail", "更新权限异常"),
    INSERT_FUNCTION_FAIL("insert.function.fail", "添加权限异常"),
    FUNCTION_URL_EXIST("function.url.exist", "该权限url已被绑定"),
    FUNCTION_NAME_ILLEGAL("function.name.illegal", "权限名字长度超过16位"),
    FUNCTION_IS_USING("function.is.using", "该权限正在使用中，禁止下架"),

    VERIFICATION_CODE_GENERATION_FAIL("verification.code.generation.fail", "验证码生成异常"),
    VERIFICATION_CODE_CHECK_FAIL("verification.code.check.fail", "验证码校验异常"),
    ILLEGAL_VERIFICATION_CODE("illegal.verification.code", "验证码有误"),
    SEND_VERIFICATION_CODE_FAIL("send.verification.code.fail", "验证码发送异常"),

    CACHE_DATA_FAIL("cache.data.fail", "用户信息缓存异常"),
    USER_IS_NOT_EXIST("user.is.not.exist", "用户不存在"),
    USER_ACCOUNT_OR_PASSWORD_ERROR("user.account.or.password.error", "用户名或密码错误"),
    UPDATE_USER_FAIL("user.update.fail", "用户信息更新异常"),
    UPDATE_USER_STATUS_FAIL("user.update.status.fail", "用户状态更新异常"),
    UPDATE_USER_PASSWORD_FAIL("user.update.password.fail", "用户密码更新异常"),
    CHECK_USER_PASSWORD_FAIL("user.check.password.fail", "用户密码验证异常"),
    USER_LOGIN_FAIL("user.login.fail", "登陆异常"),
    USER_IS_EXIST("user.is.not.exist", "用户已存在"),
    USER_LOGIN_IS_UPPER_LIMIT("user.login.is.upper.limit", "用户登陆上限，一个账号最多允许5处同时登陆"),
    USER_LOGOUT_FAIL("user.logout.fail", "用户登出异常"),
    INSERT_USER_FAIL("user.insert.fail", "添加用户异常"),
    USER_PASSWORD_SAME("user.new.password.same", "新密码不能和旧密码相同"),
    USER_PASSWORD_LENGTH_ILLEGAL("user.password.length.illegal", "密码长度应为6-12位"),

    SETMEAL_IS_EXPIRED("setmeal.is.expired", "套餐已过期"),
    CUSTOMER_IS_USING("customer is using","删除的套餐被客户占用"),

    INSERT_FUNCTION_EX_FAIL("insert.function.ex.fail", "添加权限扩展信息异常"),


    INSERT_CONTENT_FAIL("insert.content.fail", "新增内容信息异常"),
    UPDATE_CONTENT_FAIL("update.content.fail", "更新内容信息异常"),

    ADD_POINT_FAIL("add.point.fail", "获取该业务的积分信息异常"),
    POINT_NOT_EXIST("point.not.exist", "该业务的积分信息不存在"),
    UPDATE_POINT_FAIL("update.point.fail", "更新用户积分异常"),

    FILE_NULL("file.null", "文件为空"),
    USER_IMAGES_ILLEGAL_EXT("user.image.illegal.ext", "请上传图片"),
    USER_FILE_NAME_TOO_LONG("user.file.name.too.long", "用户文件名太长"),
    USER_FILE_PATH_TOO_LONG("user.file.path.too.long", "用户文件路径太长"),
    USER_FILE_TOO_BIG("user.file.too.big", "用户文件太大"),
    FOLDER_FOUND_FAIL("folder.found.fail", "文件夹不存在"),
    FILE_NOT_FOUND("file.not.found", "文件不存在"),
    FILE_FOUND_FAIL("file.found.fail", "文件查找失败"),
    FILE_CREATE_FAIL("file.create.fail", "文件创建失败"),
    FILE_UPDATE_FAIL("file.update.fail", "文件更新失败"),
    FILE_ID_NULL("file.id.null", "文件id为空"),
    FILE_MOVE_FAIL("file.move.fail", "文件移动失败"),
    FILE_DELETE_FAIL("file.delete.fail", "文件删除失败"),
    FILE_PATH_NULL("file.path.null", "文件路径为空"),
    USER_FOLDER_TOO_LONG("user.folder.too.long", "文件夹名字太长"),
    FOLDER_PARENT_FOUND_FAIL("folder.parent.found.fail", "父文件夹查找失败"),
    FOLDER_CREATE_FAIL("folder.create.fail", "文件夹创建失败"),
    FOLDER_NOT_FOUND("folder.not.found", "文件夹未找到"),
    FOLDER_UPDATE_FAIL("folder.update.fail", "文件夹更新失败"),
    FOLDER_MOVE_FAIL("folder.move.fail", "文件夹移动失败"),
    FOLDER_DELETE_FAIL("folder.delete.fail", "文件夹删除失败"),
    FOLDER_PATH_FOUND_FAIL("folder.path.found.fail", "文件夹路径查找失败"),
    IMAGE_UPLOAD_FAIL("user.image.upload.no", "图片上传失败"),
    FILE_UPLOAD_FAIL("user.file.upload.no", "文件上传失败"),

    GET_DATA_ITEM_FAIL("get.data.item.fail", "获取数据项异常")
    ;
    private final String errCode;
    private final String errMsg;

    ErrorMessages(String errCode, String errMsg){
        this.errMsg = errMsg;
        this.errCode = errCode;
    }
    @Override
    public String getErrCode() {
        return errCode;
    }
    @Override
    public String getErrMsg() {
        return errMsg;
    }

    @Override
    public String toString() {
        return this.errMsg;
    }
}
